<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">


    <div v-if="show">
      这是v-if的内容
    </div>


    <div v-show="show">
      这是v-show的内容
    </div>

    <button @click="toggle()">btn</button>

  </div>

  <script>

    var vm = new Vue({
      el: "#app",
      data: {
        show: true
      },
      methods: {
        toggle() {
          this.show = !this.show
        }
      }
    })

  </script>

</body>

</html>